package com.example.applicationtest.utils

import android.annotation.SuppressLint
import com.elvishew.xlog.LogLevel
import com.elvishew.xlog.printer.file.naming.FileNameGenerator
import java.text.SimpleDateFormat
import java.util.Date

class LogFileNameGenerator: FileNameGenerator {
    override fun isFileNameChangeable(): Boolean {
        return true
    }

    override fun generateFileName(logLevel: Int, timestamp: Long): String {
        @SuppressLint("SimpleDateFormat")
        val sdf = SimpleDateFormat("yyyy-MM-dd")
        return LogLevel.getLevelName(logLevel) + "-" + "AppLog" + "-" + sdf.format(Date(timestamp)) + ".log"
    }
}